package com.gwtgeo.ui.client.mvp.searchresults;

import com.gwtgeo.service.model.Location;
import com.gwtgeo.ui.client.mvp.adapter.RecordMapper;
import com.smartgwt.client.data.Record;

public class SearchResultRecordMapper implements RecordMapper<Location> {

	public static final String ID = "id";
	public static final String NAME = "name";
	public static final String LONGITUDE = "longitude";
	public static final String LATITUDE = "latitude";

	@Override
	public void mapAttributes(Record record, Location value) {
		record.setAttribute(ID, value.getId().toString());
		record.setAttribute(NAME, value.getName());
		record.setAttribute(LONGITUDE, value.getLongitude().doubleValue());
		record.setAttribute(LATITUDE, value.getLatitude().doubleValue());
	}
}
